home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_069 / make / h.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  3KB  |  126 lines

  1. /*
  2.  *    Include header for make
  3.  */
  4.  
  5.  
  6. #ifndef uchar
  7. #ifdef os9
  8. #define uchar        char
  9. #define void        int
  10. #define fputc        putc
  11. #else
  12. #define uchar        unsigned char
  13. #endif
  14. #endif
  15.  
  16. #define bool        uchar
  17. #define time_t        long
  18. #define TRUE        (1)
  19. #define FALSE        (0)
  20. #define max(a,b)    ((a)>(b)?(a):(b))
  21.  
  22. #define DEFN1        "makefile"    /* Default names  */
  23. #ifdef unix
  24. #define DEFN2        "Makefile"
  25. #endif
  26. #ifdef eon
  27. #define DEFN2        "Makefile"
  28. #endif
  29. /* os9 is case insensitive */
  30.  
  31. #define LZ        (1024)    /* Line size  */
  32.  
  33.  
  34.  
  35. /*
  36.  *    A name.  This represents a file, either to be made, or existant
  37.  */
  38.  
  39. struct name {
  40.     struct name    *n_next;    /* Next in the list of names */
  41.     char           *n_name;    /* Called */
  42.     struct line    *n_line;    /* Dependencies */
  43.     time_t          n_time;    /* Modify time of this name */
  44.     uchar           n_flag;    /* Info about the name */
  45. };
  46.  
  47. #define N_MARK        0x01    /* For cycle check */
  48. #define N_DONE        0x02    /* Name looked at */
  49. #define N_TARG        0x04    /* Name is a target */
  50. #define N_PREC        0x08    /* Target is precious */
  51. #define N_DOUBLE    0x10    /* Double colon target */
  52.  
  53. /*
  54.  *    Definition of a target line.
  55.  */
  56. struct line {
  57.     struct line    *l_next;    /* Next line (for ::) */
  58.     struct depend  *l_dep;    /* Dependents for this line */
  59.     struct cmd     *l_cmd;    /* Commands for this line */
  60. };
  61.  
  62.  
  63. /*
  64.  *    List of dependents for a line
  65.  */
  66. struct depend {
  67.     struct depend  *d_next;    /* Next dependent */
  68.     struct name    *d_name;    /* Name of dependent */
  69. };
  70.  
  71.  
  72. /*
  73.  *    Commands for a line
  74.  */
  75. struct cmd {
  76.     struct cmd     *c_next;    /* Next command line */
  77.     char           *c_cmd;    /* Command line */
  78. };
  79.  
  80.  
  81. /*
  82.  *    Macro storage
  83.  */
  84. struct macro {
  85.     struct macro   *m_next;    /* Next variable */
  86.     char           *m_name;    /* Called ... */
  87.     char           *m_val;    /* Its value */
  88.     uchar           m_flag;    /* Infinite loop check */
  89. };
  90.  
  91. extern char    *myname;
  92. extern struct name namehead;
  93. extern struct macro *macrohead;
  94. extern struct name *firstname;
  95. extern bool     silent;
  96. extern bool     ignore;
  97. extern bool     rules;
  98. extern bool     dotouch;
  99. extern bool     quest;
  100. extern bool     domake;
  101. extern char     str1[];
  102. extern char     str2[];
  103. extern int      lineno;
  104.  
  105. char           *fgets();
  106. char           *index();
  107. char           *rindex();
  108. char           *malloc();
  109. extern int      errno;
  110.  
  111. char           *getmacro();
  112. struct macro   *setmacro();
  113. void            input();
  114. void            error();
  115. void            fatal();
  116. int             make();
  117. struct name    *newname();
  118. struct depend  *newdep();
  119. struct cmd     *newcmd();
  120. void            newline();
  121. char           *suffix();
  122. void            touch();
  123. void            makerules();
  124. char           *gettok();
  125. void            precious();
  126.